package com.mig.tg.report;

import java.util.List;

import com.mig.tg.report.model.NewBrandReportData;
import com.mig.tg.report.model.Proposal;


public abstract class AbstractProposalState<T> implements ProposalState<T>{
	
	private ReportDataReslover<T> reslover;
	private ReportSQLBuilder sqlBuilder;
	private ReportDataGenerator<T> generator;
	
	public void handle(Proposal proposal){
		
		String SQL = sqlBuilder.buildSQL(proposal);
		
		List<T> obj = generator.getReportData(proposal,SQL);

		reslover.reslove(proposal,obj);	
	}
	
	protected abstract void reslove(Proposal proposal, List<NewBrandReportData> datas) ;

	protected abstract String buildSQL(Proposal proposal) ;

	protected abstract List<NewBrandReportData> getReportData(Proposal p, String sql) ;
	
}
